package com.ycc.usercenter.common;

import java.io.Serializable;

public class ResultUtils {

    public static <T> BaseResponse<T> sucess(T data){
        return new BaseResponse<>(data,0);
    }

    public static BaseResponse error(ErrorCode errorCode){
        return new BaseResponse(errorCode);
    }

    public static BaseResponse error(int code, String message, String description) {
        return new BaseResponse(code, message, description);
    }

    public static BaseResponse error(ErrorCode errorCode, String message, String description) {
        return new BaseResponse(errorCode.getCode(), message, description);
    }
}
